﻿Public Class FormLimitDetectionHistoryList
    Private Sub FormLimitDetectionHistoryList_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim objj As New clsProdSpec
        Dim dtable As DataTable = objj.selectSpecId()
        dtime.Text = DateTime.Now.ToShortDateString()
        Dim drspec As DataRow = dtable.NewRow()
        drspec("prod_spec_id") = "全部"
        dtable.Rows.InsertAt(drspec, 0)
        cmb_support_model.DisplayMember = "prod_spec_id"
        cmb_support_model.ValueMember = "prod_spec_id"
        cmb_support_model.DataSource = dtable
        cmb_support_model.SelectedIndex = 0
    End Sub

    Private Sub btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click
        Dim obj As New clsJxjcInfo
        Dim dt As DataTable = obj.selectAll(txt_prod_id.Text.Trim(), txt_Name.Text.Trim(), cmb_support_model.Text, dtime.Text.Trim())
        dgv2.AutoGenerateColumns = False
        dgv2.DataSource = dt
    End Sub

    Private Sub dgv2_CellDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgv2.CellDoubleClick
        Dim frmdetail As New FormLimitDetection
        If e.RowIndex > -1 And e.ColumnIndex > -1 Then
            Dim index As Integer
            index = dgv2.CurrentRow.Index
            Dim sysid As String = dgv2.Rows(index).Cells("Col_sys_id").Value
            frmdetail.Sys_id = sysid
            frmdetail.ShowDialog()
            Me.btnSearch.PerformClick()
        End If
    End Sub


End Class